/**
  ******************************************************************************
  * @author     Chris
  * @since      2024/6/18 21:59
  *
  * @file       pd_adc_ch.c
  * @brief      Xxx hardware driver.
  *
  * @note       This file contains the hardware driver for the Xxx.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date          Author       Notes
  *   2024/6/18     Chris        the first version
  *
  ******************************************************************************
  */


#include "pd_adc_ch.h"

static ADCCh *build(GPIO **gpios, uint8_t gpioSize,
                    uint32_t *ranks, uint8_t rankSize,
                    uint32_t *channels, uint8_t chSize) {
    ADCCh *adcCH = malloc(sizeof(ADCCh));

    Driver_add(adcCH, GEN_PERM);

    adcCH->gpios    = gpios;
    adcCH->gpioSize = gpioSize;
    adcCH->ranks    = ranks;
    adcCH->rankSize = rankSize;
    adcCH->channels = channels;
    adcCH->chSize   = chSize;

    return adcCH;
}

const struct ADCChannelClass ADCChBuilder = {.build = &build};